package com.mytx.search;

import com.alibaba.fastjson.JSONObject;
import com.mytx.common.pojo.CommonResult;
import com.mytx.pojo.Topic;
//import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Map;

public interface SearchService {
    /**
     * 增
     *
     * @return
     */
    @RequestMapping(value = "/index", method = RequestMethod.POST)
    CommonResult index(@RequestBody JSONObject body);

    /**
     * 删
     *
     * @param info
     * @return
     */

    @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
    CommonResult delete(@RequestBody Map<String, Object> info);

    /**
     * 改
     *
     * @return
     */
    @RequestMapping(value = "/update", method = RequestMethod.POST)
    CommonResult update(@RequestBody Topic topic);

    @PostMapping("/deleteCoupon")
    CommonResult deleteCoupon(@RequestBody String  topicId);

    /**
     * 查
     *
     * @param id 携带产品 id
     * @return
     */
    @RequestMapping(value = "/get", method = RequestMethod.POST)
    CommonResult get(@RequestBody String id);

    /**
     * 通过用户id查询
     *
     * @param info
     * @return
     */
    @RequestMapping(value = "/searchByUid", method = RequestMethod.POST)
    CommonResult searchByUid(@RequestBody Map<String, Object> info);
}
